ostree.git
10 years agoREADME: Attempt to flesh out more, start moving docs from wiki
Colin Walters [Tue, 28 Jul 2015 22:38:47 +0000 (18:38 -0400)]
README: Attempt to flesh out more, start moving docs from wiki

I'd like to migrate content from the GNOME wiki, as frankly the wiki
is crap.  Markdown in git is better in every way.

Start by fleshing out the README.md to be more useful.

10 years agoUpdate .gitignore
Jasper St. Pierre [Fri, 1 May 2015 21:53:42 +0000 (14:53 -0700)]
Update .gitignore

https://bugzilla.gnome.org/show_bug.cgi?id=752950

10 years agorepo: don't forget to abort the transaction when failed
Cosimo Cecchi [Tue, 28 Jul 2015 00:17:26 +0000 (17:17 -0700)]
repo: don't forget to abort the transaction when failed

ostree_repo_prepare_transaction() should always be matched with a call
to either ostree_repo_commit_transaction() or
ostree_repo_abort_transaction().

Since ostree_repo_pull_with_options() does not call
ostree_repo_abort_transaction() on errors, the OstreeRepo instance will
hit an assertion when it's re-used later for another attempt, such as
when the update is driven by an external component through libostree and
network temporarily goes down.

This commit simply always calls ostree_repo_abort_transaction() in the
exit path of ostree_repo_pull_with_options(), since the function is safe
to call even when we're not in a transaction, and that matches e.g. what
ostree-sysroot-cleanup.c does.

10 years agorepo: fix an incorrect comment
Cosimo Cecchi [Tue, 28 Jul 2015 00:15:21 +0000 (17:15 -0700)]
repo: fix an incorrect comment

10 years agostatic-delta: add max-bsdiff-size option
Giuseppe Scrivano [Tue, 28 Jul 2015 10:39:36 +0000 (12:39 +0200)]
static-delta: add max-bsdiff-size option

It allows to specify the maximum size for input files to attempt
bsdiff compression for.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
10 years agostatic-delta: do not fail compilation with big files
Giuseppe Scrivano [Tue, 28 Jul 2015 10:28:25 +0000 (12:28 +0200)]
static-delta: do not fail compilation with big files

Just skip the bsdiff compression instead of failing the operation.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
10 years agopull: new option --commit-metadata-only
Giuseppe Scrivano [Fri, 24 Jul 2015 09:26:57 +0000 (11:26 +0200)]
pull: new option --commit-metadata-only

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
10 years agorepo: new function _ostree_preload_metadata_file
Giuseppe Scrivano [Thu, 23 Jul 2015 11:34:58 +0000 (13:34 +0200)]
repo: new function _ostree_preload_metadata_file

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
10 years agorepo: merge repo_remote_fetch_summary_{metalink,url}
Giuseppe Scrivano [Thu, 23 Jul 2015 10:56:30 +0000 (12:56 +0200)]
repo: merge repo_remote_fetch_summary_{metalink,url}

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
10 years agolibostree: new API ostree_repo_remote_list_refs
Giuseppe Scrivano [Wed, 22 Jul 2015 10:16:51 +0000 (12:16 +0200)]
libostree: new API ostree_repo_remote_list_refs

The new API permits to query a remote repository summary file and
retrieve the list of available refs.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
10 years agotests: do not commit from the working directory
Giuseppe Scrivano [Tue, 21 Jul 2015 13:41:39 +0000 (15:41 +0200)]
tests: do not commit from the working directory

It fixes this problem:

```
error: Not a regular file or symlink: S.gpg-agent
```

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
10 years agotests: Export OSTREE_SYSROOT in setup_os_repository
Matthew Barnes [Tue, 14 Jul 2015 17:30:05 +0000 (13:30 -0400)]
tests: Export OSTREE_SYSROOT in setup_os_repository

Eliminates the need for constantly passing --sysroot=sysroot, but
also makes ostree place remote configs for sysroot/ostree/repo in
sysroot/etc/ostree/remotes.d where they should have been all along.

10 years agomain: Fix UID check based on sysroot path
Matthew Barnes [Tue, 14 Jul 2015 17:14:02 +0000 (13:14 -0400)]
main: Fix UID check based on sysroot path

This is another place where we were hard-coding a default.  Create the
OstreeSysroot first and THEN check if its path is the root directory.

10 years agorepo: Fix location of remote configs for system repos
Matthew Barnes [Mon, 13 Jul 2015 22:02:07 +0000 (18:02 -0400)]
repo: Fix location of remote configs for system repos

Need to respect the repo's system root directory instead of assuming the
compile-time $(sysconfdir).

10 years agosysroot: Pass the internal repo a system root path
Matthew Barnes [Mon, 13 Jul 2015 21:15:03 +0000 (17:15 -0400)]
sysroot: Pass the internal repo a system root path

10 years agorepo: Add a "sysroot-path" property
Matthew Barnes [Mon, 13 Jul 2015 21:12:18 +0000 (17:12 -0400)]
repo: Add a "sysroot-path" property

Adds ostree_repo_new_for_sysroot_path() to specify a system root path.
OstreeRepo otherwise uses _ostree_get_default_sysroot_path().

10 years agosysroot: Use _ostree_get_default_sysroot_path()
Matthew Barnes [Tue, 14 Jul 2015 16:02:46 +0000 (12:02 -0400)]
sysroot: Use _ostree_get_default_sysroot_path()

Instead of hard-coding the root directory as default.

10 years agocore: Add _ostree_get_default_sysroot_path()
Matthew Barnes [Tue, 14 Jul 2015 15:58:00 +0000 (11:58 -0400)]
core: Add _ostree_get_default_sysroot_path()

Returns a GFile for the default system root, which is usually the root
directory unless overridden by the OSTREE_SYSROOT environment variable
(which is mainly intended for testing).

10 years agopull: Plug a memory leak
Colin Walters [Tue, 30 Jun 2015 01:57:29 +0000 (21:57 -0400)]
pull: Plug a memory leak

10 years agopull: Avoid leaking signal handlers across fetch requests
Colin Walters [Tue, 30 Jun 2015 01:56:03 +0000 (21:56 -0400)]
pull: Avoid leaking signal handlers across fetch requests

libsoup will cache sessions, so it might be the case that we get a
reused session when pulling from the same repo multiple times in one
process.

In this case we were leaking signal connections, which caused
callbacks into freed memory with bad consequences.

Fix it by tying the signal connection to the object lifetime.

10 years agobuild: Make gtk-doc optional
Jeremy Cline [Mon, 29 Jun 2015 17:20:57 +0000 (13:20 -0400)]
build: Make gtk-doc optional

This is similar to what's done in glib.

10 years agotests: Check error messages instead of "expected-fail", handle old parallel
Colin Walters [Mon, 29 Jun 2015 17:35:07 +0000 (13:35 -0400)]
tests: Check error messages instead of "expected-fail", handle old parallel

10 years agopull: Also fix misplaced remote name handling
Colin Walters [Mon, 29 Jun 2015 15:20:41 +0000 (11:20 -0400)]
pull: Also fix misplaced remote name handling

We want to set the remote name only if we're operating on a remote
URL.

10 years agocore: Fix inverted conditional in GPG checking
Colin Walters [Mon, 29 Jun 2015 15:09:00 +0000 (11:09 -0400)]
core: Fix inverted conditional in GPG checking

10 years agopull: Error if gpg=true and summary is 404, add more tests
Colin Walters [Sat, 27 Jun 2015 16:00:49 +0000 (12:00 -0400)]
pull: Error if gpg=true and summary is 404, add more tests

I did a quick audit pass through the pull code.  What I focused on the
most is the case where `gpg-verify-summary=true`, and in particular
where `gpg-verify=false` too.  This should be a valid and secure
configuration.

The primary change here is to error out very quickly if either
`summary` or `summary.sig` are 404.  Previously, we'd only error out
if we were processing deltas.

Expand the existing test case to cover this, plus invalid summary and
invalid sig.  (The test case was failing with current git master too).

10 years agoostree_repo_remote_fetch_summary: honor gpg-verify-summary
Giuseppe Scrivano [Wed, 24 Jun 2015 12:19:34 +0000 (14:19 +0200)]
ostree_repo_remote_fetch_summary: honor gpg-verify-summary

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
10 years agotests: add test for check for remote add --set=gpg-verify-summary=true
Giuseppe Scrivano [Wed, 3 Jun 2015 10:55:30 +0000 (12:55 +0200)]
tests: add test for check for remote add --set=gpg-verify-summary=true

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
10 years agopull: fail if GPG is enabled and the summary is not signed
Giuseppe Scrivano [Wed, 27 May 2015 08:35:09 +0000 (10:35 +0200)]
pull: fail if GPG is enabled and the summary is not signed

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
10 years agorepo: new function ostree_repo_remote_get_gpg_verify_summary
Giuseppe Scrivano [Wed, 3 Jun 2015 08:18:03 +0000 (10:18 +0200)]
repo: new function ostree_repo_remote_get_gpg_verify_summary

It allows to specify whether GPG verification for the summary file is
enabled for a specific repository.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
10 years agopull: verify summary signatures also when not mirroring
Giuseppe Scrivano [Wed, 27 May 2015 08:12:11 +0000 (10:12 +0200)]
pull: verify summary signatures also when not mirroring

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
10 years agoostree: Add a "remote refs" command
Matthew Barnes [Sun, 7 Jun 2015 19:20:14 +0000 (15:20 -0400)]
ostree: Add a "remote refs" command

Works like "ostree refs" but fetches refs from a remote repo.

This depends on the remote repo having a summary file, but any repo
being served over HTTP *ought* to have one.

10 years agorepo: Add ostree_repo_remote_fetch_summary()
Matthew Barnes [Sun, 7 Jun 2015 17:41:04 +0000 (13:41 -0400)]
repo: Add ostree_repo_remote_fetch_summary()

Reusable method for fetching a summary file and signatures.

10 years agometalink: Return requested file as a GBytes
Matthew Barnes [Wed, 10 Jun 2015 19:40:42 +0000 (15:40 -0400)]
metalink: Return requested file as a GBytes

This may not be the best idea for general usage, but the only use case
for metalinks currently is fetching a summary file and those are pretty
small.  Far more convenient to return the file content in a GBytes.

10 years agometalink: Allow NULL for "out" params in metalink requests
Matthew Barnes [Wed, 10 Jun 2015 18:37:42 +0000 (14:37 -0400)]
metalink: Allow NULL for "out" params in metalink requests

Caller may not be interested in all the outbound params, particularly
"fetching_sync_uri".

10 years agorepo: Redo ostree_repo_remote_get_url()
Matthew Barnes [Sat, 6 Jun 2015 20:47:15 +0000 (16:47 -0400)]
repo: Redo ostree_repo_remote_get_url()

Make it work like in ostree_repo_pull_with_options(), handling "file://"
remotes and inheriting the "url" option from parent repos if needed.

10 years agorepo: Handle "file" remotes in ostree_repo_remote_get_gpg_verify()
Matthew Barnes [Sat, 6 Jun 2015 20:32:45 +0000 (16:32 -0400)]
repo: Handle "file" remotes in ostree_repo_remote_get_gpg_verify()

10 years agorepo: Add _ostree_repo_get_remote_option_inherit()
Matthew Barnes [Sat, 6 Jun 2015 19:52:44 +0000 (15:52 -0400)]
repo: Add _ostree_repo_get_remote_option_inherit()

Split out from ostree-repo-pull.c.  Still private but more reusable now.

10 years agorepo: Add _ostree_repo_remote_new_fetcher()
Matthew Barnes [Fri, 5 Jun 2015 20:39:11 +0000 (16:39 -0400)]
repo: Add _ostree_repo_remote_new_fetcher()

Creates and configures an OstreeFetcher instance for a given remote.

Split out from ostree_repo_pull_with_options().

10 years agodiff: Fix adding CLI options twice
Matthew Barnes [Thu, 18 Jun 2015 21:58:13 +0000 (17:58 -0400)]
diff: Fix adding CLI options twice

10 years agotests/metalink: Add a case with nested unknown elements
Colin Walters [Tue, 16 Jun 2015 01:09:37 +0000 (21:09 -0400)]
tests/metalink: Add a case with nested unknown elements

10 years agometalink: Fix behavior when requested file is not found
Matthew Barnes [Sun, 14 Jun 2015 19:33:22 +0000 (15:33 -0400)]
metalink: Fix behavior when requested file is not found

The state machine's "passthrough_previous" field never got set, so the
machine gets put back into the wrong state after a passthrough phase.
Couple other minor issues around error handling.

10 years agopull-local: Support --depth option
Dan Nicholson [Mon, 8 Jun 2015 17:11:11 +0000 (10:11 -0700)]
pull-local: Support --depth option

Like pull, allow pull-local to mirror another another repository by
specifying how many parents to traverse.

https://bugzilla.gnome.org/show_bug.cgi?id=750581

10 years agotests/test-pull-mirror-summary.sh: remove empty newline
Giuseppe Scrivano [Fri, 12 Jun 2015 11:10:02 +0000 (13:10 +0200)]
tests/test-pull-mirror-summary.sh: remove empty newline

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
10 years agoautogen.sh: fix typo
Giuseppe Scrivano [Fri, 12 Jun 2015 07:43:34 +0000 (09:43 +0200)]
autogen.sh: fix typo

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
10 years agorepo: Change GPG verification policy
Matthew Barnes [Fri, 5 Jun 2015 16:45:41 +0000 (12:45 -0400)]
repo: Change GPG verification policy

The global keyring directory (trusted.gpg.d) is deprecated.  Only use it
when a specified remote does NOT have its own keyring, or when verifying
local repository objects.

Note, because mixing in the global keyring directory is now an explicit
choice, OstreeGpgVerifier no longer needs to implement GInitableIface.

10 years agoFix double free in ostree_repo_pull_with_options
John Hiesey [Wed, 6 May 2015 23:43:06 +0000 (16:43 -0700)]
Fix double free in ostree_repo_pull_with_options

Duplicate the commit checksum for expected_commit_sizes since it's also
used as a value in requested_refs_to_fetch.

https://bugzilla.gnome.org/show_bug.cgi?id=750366

10 years agoRevert "tests: skip test-commit-sign.sh when not root"
Dan Nicholson [Wed, 3 Jun 2015 20:02:41 +0000 (13:02 -0700)]
Revert "tests: skip test-commit-sign.sh when not root"

This reverts commit d3545b0661f3247cd8c106e64a71052ce9952243. Since the
test is now using the temporary copy of the gpg homedir, it is no longer
owned by root.

10 years agotests: Use temporary gpg homedir
Dan Nicholson [Wed, 3 Jun 2015 19:54:36 +0000 (12:54 -0700)]
tests: Use temporary gpg homedir

libtest always makes a copy of the gpghome directory to the test
directory, so there's no need to operate on the installed copy. This
allows test-remote-gpg-import to pass as an unprivileged user since it
otherwise couldn't create the temp files gpgme creates.

10 years agotests: Use readdir64 when _FILE_OFFSET_BITS set
Dan Nicholson [Wed, 3 Jun 2015 19:34:37 +0000 (12:34 -0700)]
tests: Use readdir64 when _FILE_OFFSET_BITS set

On 32 bit systems, _FILE_OFFSET_BITS will be set to 64 by
AC_SYS_LARGEFILE. This causes the glibc headers to use readdir64 rather
than readdir. Emulate that behavior in the preloader or the tests will
all fail with "No such file or directory".

10 years agotests: Link test-gpg-verify-result with gpgme
Dan Nicholson [Tue, 12 May 2015 22:48:22 +0000 (15:48 -0700)]
tests: Link test-gpg-verify-result with gpgme

This test uses gpgme directly to verify the signatures, so it needs to
find the gpgme headers and link with gpgme to ensure the linker can
resolve the symbols.

10 years agoFix tests on 32 bit systems
John Hiesey [Wed, 6 May 2015 23:41:55 +0000 (16:41 -0700)]
Fix tests on 32 bit systems

Use guint64 when the 't' format is used for GVariant

10 years agogpg: Gracefully handle no trusted.gpg.d directory
Matthew Barnes [Thu, 28 May 2015 20:25:51 +0000 (16:25 -0400)]
gpg: Gracefully handle no trusted.gpg.d directory

This is a deprecated fallback method anyway.  We prefer
remote-specific keyrings now.

https://bugzilla.gnome.org/750049

10 years agoRelease 2015.7
Colin Walters [Tue, 2 Jun 2015 16:59:48 +0000 (12:59 -0400)]
Release 2015.7

10 years agotests/remote-gpg-import: Only commit workdir
Colin Walters [Tue, 2 Jun 2015 16:38:26 +0000 (12:38 -0400)]
tests/remote-gpg-import: Only commit workdir

Just noticed this while debugging something else.  We don't want to
commit the whole test dir, just the workdir.

Trying to commit the repo itself is potentially subject to race
conditions at least.

10 years agotests: Run all tests through a randomized readdir()
Colin Walters [Tue, 2 Jun 2015 02:34:14 +0000 (22:34 -0400)]
tests: Run all tests through a randomized readdir()

Having undefined (but in practice rarely changing) ordering for
`readdir()` ended up screwing us over for bootloader config
generation; see https://bugzilla.redhat.com/show_bug.cgi?id=1226520

Let's make things significantly more likely to fail more quickly in
the future if similar bugs are introduced.  We accomplish this by
introducing a little `LD_PRELOAD` library that randomizes the results
of `readdir()`.

10 years agoRevert "tests: Run all tests through a randomized readdir()"
Colin Walters [Tue, 2 Jun 2015 16:02:24 +0000 (12:02 -0400)]
Revert "tests: Run all tests through a randomized readdir()"

Unintentionally pushed.

This reverts commit ce49264157f9005e664557613cbbf67f54174682.

10 years agotests: Add a test-pull-summary-sigs
Colin Walters [Mon, 1 Jun 2015 22:40:44 +0000 (18:40 -0400)]
tests: Add a test-pull-summary-sigs

This is intended to cover non-mirroring usage of GPG + summary +
deltas.

10 years agorepo: Don't crash when creating a summary if we have --empty deltas
Colin Walters [Mon, 1 Jun 2015 22:40:04 +0000 (18:40 -0400)]
repo: Don't crash when creating a summary if we have --empty deltas

10 years agotests: Add a commented out test for mirroring with deltas
Colin Walters [Mon, 1 Jun 2015 22:15:42 +0000 (18:15 -0400)]
tests: Add a commented out test for mirroring with deltas

10 years agopull: Validate delta checksums more strongly
Colin Walters [Mon, 1 Jun 2015 20:56:19 +0000 (16:56 -0400)]
pull: Validate delta checksums more strongly

We need to check that it's 'ay'.  Also reuse the existing validation
function to check it's 32 bytes rather than potentially crashing with
assertion.

Just noticed this during a code review.

10 years agopull: Ensure console state for multiple GPG verification messages
Colin Walters [Mon, 1 Jun 2015 21:39:39 +0000 (17:39 -0400)]
pull: Ensure console state for multiple GPG verification messages

If there are multiple signatures to verify, we would attempt to
display them multiple times, but we can only call
`gs_console_end_status_line()` if the console has been enabled.

Ensure we turn back on the console after printing our status.  This
will result in extra newlines, but fixing that cleanly would require a
saner GSConsole API.

10 years agotests: Run all tests through a randomized readdir()
Colin Walters [Tue, 2 Jun 2015 02:34:14 +0000 (22:34 -0400)]
tests: Run all tests through a randomized readdir()

Having undefined ordering (but in practice rarely changing)
ordering for `readdir()` ended up screwing us over with respect
to bootloader config file read ordering.

Let's make things significantly more likely to fail more quickly in
the future if similar bugs are introduced.  We accomplish this by
introducing a little `LD_PRELOAD` library that randomizes the results
of `readdir()`.

10 years agotests: Add a crosscheck for syslinux bootloader config generation
Colin Walters [Thu, 28 May 2015 00:08:44 +0000 (20:08 -0400)]
tests: Add a crosscheck for syslinux bootloader config generation

And actually wire this one up in admin-test.sh.

10 years agotests: Add a test script to cross-check loader config vs GRUB2
Colin Walters [Wed, 27 May 2015 02:28:29 +0000 (22:28 -0400)]
tests: Add a test script to cross-check loader config vs GRUB2

One can run this on a machine to validate things.  I'd like to
get this plugged into the actual OSTree tests as soon as we can
figure out how to sanely run grub2-generate as non-root in
our test suite.

Alternatively, this script can easily be run on a real install.

10 years agosysroot: Sort returned boot loader configs
Colin Walters [Tue, 26 May 2015 22:46:47 +0000 (18:46 -0400)]
sysroot: Sort returned boot loader configs

I haven't done a full dig through the history, but it seems quite
possible right now we've been relying on inode enumeration
order for generating bootloader configuration.

Most of the time, newer inodes (i.e. later written files) will win.
But that's obviously not reliable.

Fix this by sorting the returned configuration internally.

10 years agoFix annotations on ostree_repo_remote_gpg_import().
Jeff Ortel [Tue, 26 May 2015 16:17:28 +0000 (11:17 -0500)]
Fix annotations on ostree_repo_remote_gpg_import().

10 years agoostree-repo: document OSTREE_REPO_COMMIT_MODIFIER_FLAGS_GENERATE_SIZES
Giuseppe Scrivano [Tue, 19 May 2015 09:12:14 +0000 (11:12 +0200)]
ostree-repo: document OSTREE_REPO_COMMIT_MODIFIER_FLAGS_GENERATE_SIZES

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
10 years agoadmin: Ensure instutil commands and usage help don't grab lock
Colin Walters [Fri, 15 May 2015 12:51:47 +0000 (08:51 -0400)]
admin: Ensure instutil commands and usage help don't grab lock

When I was introducing the `_UNLOCKED` flag, I only audited
subcommands of `ostree admin`, but I missed that `ostree admin
instutil` also used the option parsing.  Those are only used by
Anaconda today so we can ignore them for locking purposes.

Also, the usage help generation was grabbing the lock unnecessarily.

10 years agorepo: Prevent GPG keys from being imported to keybox format
Matthew Barnes [Thu, 14 May 2015 16:44:36 +0000 (12:44 -0400)]
repo: Prevent GPG keys from being imported to keybox format

If a remote keyring does not already exist, create an empty pubring.gpg
file in the temporary directory prior to importing keys.  This prevents
gpg2 from creating a pubring.kbx file in the new keybox format [1].  We
want to stay with the older keyring format since its performances issues
are not relevant here.

[1] https://gnupg.org/faq/whats-new-in-2.1.html#keybox

10 years agorepo: Bump mtime any time we write a ref
Colin Walters [Thu, 14 May 2015 01:59:17 +0000 (21:59 -0400)]
repo: Bump mtime any time we write a ref

External daemons like rpm-ostree want push notification any time a
change is made by an external entity.  inotify provides notification,
but a problem is there's no easy way to monitor all of the refs.

In the past, there has been discussion of opt-in recursive timestamps:
https://lkml.org/lkml/2013/4/5/307

But in today's world, let's just bump the mtime on the repo itself, as
a central inotify point.

Closes: https://github.com/GNOME/ostree/pull/111
10 years agoostree-repo: replace more gs_unref_(variant|bytes) with g_autoptr
Giuseppe Scrivano [Thu, 14 May 2015 07:56:00 +0000 (09:56 +0200)]
ostree-repo: replace more gs_unref_(variant|bytes) with g_autoptr

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
10 years agotest-basic: Always chown back before doing assertion
Colin Walters [Thu, 14 May 2015 02:17:26 +0000 (22:17 -0400)]
test-basic: Always chown back before doing assertion

Sometimes I rerun the tests for debugging in the same directory, and
having it be not writable breaks `rm * -rf`.

10 years agotests: Fix writable repo test
Colin Walters [Thu, 14 May 2015 02:11:39 +0000 (22:11 -0400)]
tests: Fix writable repo test

When I removed the `transaction` symlink, that made this test start
failing.  Fix it by doing `chmod` on `repo/objects`, which is what the
core `ostree_repo_is_writable()` looks at.

10 years agoadmin: Use locking for most sysroot commands
Colin Walters [Wed, 13 May 2015 20:48:09 +0000 (16:48 -0400)]
admin: Use locking for most sysroot commands

The previous commit introduced locking for `ostree admin deploy`, but
we do expect people to possibly accidentally do e.g.
`ostree admin upgrade` concurrently.

Using consistent locking in the admin commands will help rpm-ostree.

Closes: https://github.com/GNOME/ostree/pull/110
10 years agotests: Add test-remote-gpg-import.sh
Matthew Barnes [Thu, 7 May 2015 17:42:19 +0000 (13:42 -0400)]
tests: Add test-remote-gpg-import.sh

10 years agoostree: Add --gpg-import to the "remote add" command
Matthew Barnes [Sat, 9 May 2015 13:50:24 +0000 (09:50 -0400)]
ostree: Add --gpg-import to the "remote add" command

Convenience option imports GPG keys for a newly-created remote.

10 years agoostree: Add a "remote gpg-import" command
Matthew Barnes [Fri, 1 May 2015 13:09:42 +0000 (09:09 -0400)]
ostree: Add a "remote gpg-import" command

Imports GPG keys into a remote-specific keyring.

10 years agorepo: Add remote's keyring during GPG verification
Matthew Barnes [Fri, 1 May 2015 19:38:08 +0000 (15:38 -0400)]
repo: Add remote's keyring during GPG verification

This is pretty fugly but it at least avoids new public API.

10 years agorepo: Add ostree_repo_remote_gpg_import()
Matthew Barnes [Tue, 28 Apr 2015 17:26:00 +0000 (13:26 -0400)]
repo: Add ostree_repo_remote_gpg_import()

Imports one or more GPG keys from a source stream or from the user's
personal keyring into a remote-specific keyring.  The keys to import
can optionally be restricted by a list of key IDs.

The imported keys are used to conduct GPG verification when pulling
from the given remote.

10 years agorepo: Delete a remote's keyring when deleting a remote
Matthew Barnes [Fri, 1 May 2015 14:06:24 +0000 (10:06 -0400)]
repo: Delete a remote's keyring when deleting a remote

10 years agorepo: Stash keyring name in OstreeRemote
Matthew Barnes [Tue, 28 Apr 2015 17:32:32 +0000 (13:32 -0400)]
repo: Stash keyring name in OstreeRemote

10 years agomaint.mk: Remove GNU releases specific bits
Giuseppe Scrivano [Tue, 12 May 2015 07:48:43 +0000 (09:48 +0200)]
maint.mk: Remove GNU releases specific bits

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
10 years agosyntax-check: add syntactic rule to prohibit gs_strfreev
Giuseppe Scrivano [Tue, 12 May 2015 07:41:44 +0000 (09:41 +0200)]
syntax-check: add syntactic rule to prohibit gs_strfreev

and fix an instance.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
10 years agosyntax-check: add syntactic rule to prohibit gs_unref_*
Giuseppe Scrivano [Tue, 12 May 2015 07:39:13 +0000 (09:39 +0200)]
syntax-check: add syntactic rule to prohibit gs_unref_*

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
10 years agotests: add new test for pull --disable-static-deltas
Giuseppe Scrivano [Tue, 12 May 2015 08:57:03 +0000 (10:57 +0200)]
tests: add new test for pull --disable-static-deltas

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
10 years agodoc: add missing options block for pull
Giuseppe Scrivano [Tue, 12 May 2015 08:39:37 +0000 (10:39 +0200)]
doc: add missing options block for pull

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
10 years agopull: add new switch option --disable-static-deltas
Giuseppe Scrivano [Tue, 12 May 2015 08:15:30 +0000 (10:15 +0200)]
pull: add new switch option --disable-static-deltas

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
10 years agoostree-repo-pull: add option to disable static-deltas
Giuseppe Scrivano [Tue, 12 May 2015 08:06:56 +0000 (10:06 +0200)]
ostree-repo-pull: add option to disable static-deltas

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
10 years agosysroot: Add a try_lock() API
Colin Walters [Thu, 7 May 2015 02:19:05 +0000 (22:19 -0400)]
sysroot: Add a try_lock() API

The blocking locking API wasn't sufficient for use in the rpm-ostree
daemon; it really wants to know if the lock is held, then continue to
do other things (like service DBus requests), and get notification
when the lock is available.

We also add an async variant that can be called if the lock is not
available.

Implement a higher level "loop until lock is available" method in the
`ostree admin` commandline.

10 years agorepo: Simplify sign_data() a little
Matthew Barnes [Thu, 7 May 2015 21:50:22 +0000 (17:50 -0400)]
repo: Simplify sign_data() a little

Use ot_gpgme_data_output() to wrapper a GOutputStream.

10 years agogpg: Add custom data buffers to wrapper GIO streams
Matthew Barnes [Thu, 7 May 2015 21:02:37 +0000 (17:02 -0400)]
gpg: Add custom data buffers to wrapper GIO streams

ot_gpgme_data_input() and ot_gpgme_data_output(), shamelessly ripped
off from seahorse_gpgme_data_input() and seahorse_gpgme_data_output().

10 years agogpg: Fix ot_gpgme_error_to_gio_error()
Matthew Barnes [Thu, 7 May 2015 20:02:39 +0000 (16:02 -0400)]
gpg: Fix ot_gpgme_error_to_gio_error()

Need to extract the error code from a gpgme_error_t, can't just compare
it directly.

10 years agoot-fs-utils: remove empty line at EOF
Giuseppe Scrivano [Thu, 7 May 2015 19:59:30 +0000 (21:59 +0200)]
ot-fs-utils: remove empty line at EOF

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
10 years agosummary: delete summary.sig on an update
Giuseppe Scrivano [Mon, 4 May 2015 09:05:23 +0000 (11:05 +0200)]
summary: delete summary.sig on an update

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
10 years agotests: add a test for signed summary file
Giuseppe Scrivano [Thu, 30 Apr 2015 07:36:27 +0000 (09:36 +0200)]
tests: add a test for signed summary file

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
10 years agopull: verify signature for the summary file
Giuseppe Scrivano [Wed, 29 Apr 2015 13:24:28 +0000 (15:24 +0200)]
pull: verify signature for the summary file

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
10 years agosummary: add new command line arguments to sign the summary file
Giuseppe Scrivano [Wed, 29 Apr 2015 09:43:17 +0000 (11:43 +0200)]
summary: add new command line arguments to sign the summary file

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
10 years agoostree-repo: add new API to sign the summary file
Giuseppe Scrivano [Sun, 3 May 2015 20:40:27 +0000 (22:40 +0200)]
ostree-repo: add new API to sign the summary file

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
10 years agopull: get rid of detached metadata for deltas
Giuseppe Scrivano [Tue, 28 Apr 2015 16:47:21 +0000 (18:47 +0200)]
pull: get rid of detached metadata for deltas

Once the summary file will be signed, we can validate the superblock
from there.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
10 years agopull: check that the superblock checksum is the same as in the summary
Giuseppe Scrivano [Tue, 28 Apr 2015 16:45:11 +0000 (18:45 +0200)]
pull: check that the superblock checksum is the same as in the summary

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>